﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class ModelerModule : OdRxModule
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public ModelerModule(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.ModelerModule_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(ModelerModule obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~ModelerModule()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_ModelerModule(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public virtual OdResult setTriangulationParams(wrTriangulationParams TriangulationParams)
		{
			OdResult result = (OdResult)GlobalsPINVOKE.ModelerModule_setTriangulationParams(this.swigCPtr, wrTriangulationParams.getCPtr(TriangulationParams));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getTriangulationParams(wrTriangulationParams TriangulationParams)
		{
			GlobalsPINVOKE.ModelerModule_getTriangulationParams(this.swigCPtr, wrTriangulationParams.getCPtr(TriangulationParams));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual IntPtr dummy()
		{
			IntPtr result = GlobalsPINVOKE.ModelerModule_dummy(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
